Release 10.1A: OpenEdge Data Management:
SQL Reference
NEXTVAL
NEXTVALreturns a sequence’s next value. References toNEXTVALincrement the sequence value by the defined increment and return the new value.Use the following syntax to reference the next value of a sequence:
schemaSpecifies the schema that contains the sequence. To refer to the next value of a sequence in the schema of another user, you must have
SELECTobject privilege on the sequence.sequenceSpecifies the name of the sequence whose next value you want.
Note: A statement referencingNEXTVALfor a noncycling sequence returns an error after reaching the maximum value.Use
NEXTVALin the:
NEXTVALcannot be used in:Example Note: Sequences are not associated with tables. This example provides reference to a table in order to conform to correct OpenEdge SQL syntax.
- A query of a view.
- A
SELECTstatement with aGROUP BYclause that references a sequence.- A
SELECTstatement with anORDER BYclause that references a sequence.- A
SELECTstatement that is combined with anotherSELECTstatement with theUNION,INTERSECT, orMINUSset operator.- The
WHEREclause of aSELECTorUPDATEstatement.- The
DEFAULTvalue of a column in aCREATE TABLEorALTER TABLEstatement.- The condition of a
CHECKconstraint.In the following example, the sequence generator increments the customer sequence and uses its value for a new customer inserted into the table
pub.customer:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |